<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<meta charset="UTF-8">
<!--侧边栏-->
<!-- 侧边菜单 -->
<div id="side_nav" class="layui-side layui-side-menu" lay-filter="side_nav">
    <div class="layui-side-scroll">
        <div class="layui-logo" lay-href=""><span>地产管理系统</span></div>
        <ul class="layui-nav layui-nav-tree" lay-shrink="all" lay-filter="slide">
            <!--一级菜单-->
            <li class="layui-nav-item">
                <a href="javascript:void(0);">
                    <i class="layui-icon layui-icon-user"></i>
                    <cite>用户管理</cite>
                    <span class="layui-nav-more"></span>
                </a>
                <dl class="layui-nav-child">
                    <dd>
                        <a lay-id="index" href="/index" class="jump_refresh_url">用户账号管理</a>
                    </dd>
                    <dd>
                        <a lay-id="userRight" href="/userRight" class="jump_refresh_url">用户权限管理</a>
                    </dd>
                </dl>
            </li>
            <li class="layui-nav-item">
                <a href="javascript:void(0);">
                    <i class="layui-icon layui-icon-util"></i>
                    <cite>客户管理</cite>
                    <span class="layui-nav-more"></span>
                </a>
                <dl class="layui-nav-child">
                    <dd>
                        <a lay-id="customerIndex" href="/customerIndex" class="jump_refresh_url">客户信息管理</a>
                    </dd>
                    <dd>
                        <a lay-id="" href="/realName" class="jump_refresh_url">实名认证管理</a>
                    </dd>
                    <dd>
                        <a lay-id="" href="/" class="jump_refresh_url">资质认证管理</a>
                    </dd>
                    <dd>
                        <a lay-id="" href="/" class="jump_refresh_url">经纪人认证管理</a>
                    </dd>
                </dl>
            </li>
            <li class="layui-nav-item">
                <a href="javascript:void(0);">
                    <i class="layui-icon layui-icon-util"></i>
                    <cite>模版下拉菜单</cite>
                    <span class="layui-nav-more"></span>
                </a>
                <dl class="layui-nav-child">
                    <!--三级菜单-->
                    <dd>
                        <a href="javascript:void(0);">表单<span class="layui-nav-more"></span></a>
                        <dl class="layui-nav-child">
                            <dd>
                                <a href="javascript:void(0);">表单<span class="layui-nav-more"></span></a>
                                <dl class="layui-nav-child">
                                    <dd>
                                        <a lay-href="component/form/group.html">表单组合</a>
                                    </dd>
                                    <dd>
                                        <a lay-href="component/form/group.html">表单组合</a>
                                    </dd>
                                </dl>
                            </dd>
                            <dd>
                                <a lay-href="component/form/group.html">表单组合</a>
                            </dd>
                        </dl>
                    </dd>
                    <!--两级菜单-->
                    <dd>
                        <a href="javascript:void(0);">调试预览2<span class="layui-nav-more"></span></a>
                        <dl class="layui-nav-child">
                            <dd>
                                <a lay-href="component/form/group.html">表单组合</a>
                            </dd>
                            <dd>
                                <a lay-href="component/form/group.html">表单组合</a>
                            </dd>
                        </dl>
                    </dd>
                </dl>
            </li>
        </ul>
    </div>
</div>
<script>
    /*导航跳转显示对应栏目*/
    $(function () {
        var url =GetUrlRelativePath()
        refreshHighlight(url)
    })
    /*通过判断获取到的url去打开对应的导航菜单*/
    function refreshHighlight(url) {
        $ = layui.jquery;
        $(".layui-nav[lay-filter='slide'] a").each(function (ind, val) {
            if($(this).attr('href') === url){
                $('.layui-nav dd').removeClass('layui-this');
                $(this).parent('dd').addClass('layui-this');
                $(this).parents(".layui-nav-item").addClass('layui-nav-itemed');
            }
        })
    }
    function GetUrlRelativePath()
    {
        var url = document.location.toString();
        var arrUrl = url.split("//");

        var start = arrUrl[1].indexOf("/");
        var relUrl = arrUrl[1].substring(start);//stop省略，截取从start开始到结尾的所有字符

        if(relUrl.indexOf("?") != -1){
            relUrl = relUrl.split("?")[0];
        }
        return relUrl;
    }
</script>